using UnityEngine;
using QFramework;

namespace Survivor
{
	public partial class AbilitiesController : ViewController,IController
	{
		void Start()
		{
			Global.SimpleAttackUnlock.RegisterWithInitValue((unlock)=>
			{
				if (unlock) SimpleAbilities.Show();
			}).UnRegisterWhenGameObjectDestroyed(this);
			Global.SimpleAxeUnlock.RegisterWithInitValue((unlock)=>
			{
				if (unlock) SimpleAxe.Show();
			}).UnRegisterWhenGameObjectDestroyed(this);
			Global.SimpleKnifeUnlock.RegisterWithInitValue((unlock)=>
			{
				if (unlock) SimpleKnife.Show();
			}).UnRegisterWhenGameObjectDestroyed(this);
			Global.SimpleCircleUnlock.RegisterWithInitValue((unlock)=>
			{
				if (unlock) SimpleCircle.Show();
			}).UnRegisterWhenGameObjectDestroyed(this);
			
			this.GetSystem<ExpUpgradeSystem>().GetRandomItemsExcludePassive().Upgrade();
		}

		public IArchitecture GetArchitecture()
		{
			return Global.Interface;
		}
	}
}
